package com.library.books.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.library.books.domain.BooksRule;
import com.library.books.domain.vo.BooksJoinBooksCopyJoinBooksRule;
import com.library.books.mapper.BooksRuleMapper;
import com.library.books.service.IBooksRuleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 书籍规则Service业务层处理
 *
 * @author hb
 * @date 2024-10-14
 */
@Service
public class BooksRuleServiceImpl extends ServiceImpl<BooksRuleMapper, BooksRule> implements IBooksRuleService
{


    /**
     * 查询书籍规则列表
     *
     *
     * @param booksRule 书籍规则
     * @return 书籍规则
     */
    @Override
    public List<BooksRule> selectBooksRuleList(BooksRule booksRule) {
        return baseMapper.selectBooksRuleList(booksRule);
    }

    /**
     * 根据书籍副本id查询书籍规则详情
     *
     * @param booksCopyId 书籍副本id
     * @return 书籍规则信息
     */
    @Override
    public BooksRule selectBooksRuleInfoByBooksCopyId(Long booksCopyId) {
        return baseMapper.selectBooksRuleInfoByBooksCopyId(booksCopyId);
    }

    /**
     * 根据书籍副本id查询书籍详情和书籍规则详情
     * # 暂不需要校验编目和副本的软删除
     *
     * @param booksCopyId 书籍副本id
     * @return 书籍规则信息
     */
    @Override
    public BooksJoinBooksCopyJoinBooksRule selectBooksRuleInfoAndBooksInfoByBooksCopyId(Long booksCopyId) {
        return baseMapper.selectBooksRuleInfoAndBooksInfoByBooksCopyId(booksCopyId);
    }

}
